home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5427 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Can I assume the FIRST field of a STRUCT is at OFFSET 0?
  5. Date: Fri, 09 Feb 96 13:55:02 GMT
  6. Organization: none
  7. Distribution: world
  8. Message-ID: <823874102snz@genesis.demon.co.uk>
  9. References: <KIN.96Feb7142238@sampras.isi.com>
  10. Reply-To: fred@genesis.demon.co.uk
  11. X-NNTP-Posting-Host: genesis.demon.co.uk
  12. X-Newsreader: Demon Internet Simple News v1.27
  13. X-Mail2News-Path: genesis.demon.co.uk
  14.  
  15. In article <KIN.96Feb7142238@sampras.isi.com> kin@isi.com "Kin Cho" writes:
  16.  
  17. >I couldn't find reference to this in the K&C book.
  18. >Is this specified one way or the other in ANSI C?
  19. >Have you run into a platform where this assumption fails?
  20.  
  21. The standard says:
  22.  
  23. "There may therefore be unnamed padding within a structure object, but
  24.  not at its beginning..."
  25.  
  26. So the first structure member is required to be at offset 0.
  27.  
  28. -- 
  29. -----------------------------------------
  30. Lawrence Kirby | fred@genesis.demon.co.uk
  31. Wilts, England | 70734.126@compuserve.com
  32. -----------------------------------------
  33.